
<!-- 账号操作-->
<div class="panel panel-warning">
    <div class="panel-heading">
        {{$title_act}} : 开启与禁用是互斥操作
        <a class="label label-info" href="#" role="button">开启</a>
        <a class="label label-warning" href="#" role="button">禁用</a>
    </div>
  <div class="panel-body">
    <p>
    </p>
    <a class="btn btn-info account-act" href="#" role="button" data-fld="is_seal_number" data-val="1">ON:seal account</a>
    <a class="btn btn-warning account-act" href="#" role="button" data-fld="is_seal_number" data-val="2">OFF:unseal account</a>
    <a class="btn btn-info account-act" href="#" role="button" data-fld="freeze" data-val="0">ON:解冻账号</a>
    <a class="btn btn-warning account-act" href="#" role="button" data-fld="freeze" data-val="1">OFF:冻结账号</a>
  </div>
</div>

<!-- 账号详情-->
<div class="panel panel-info">
    <div class="panel-heading">
        player info
    </div>
  <div class="panel-body player_show_detail_table">
        <div class="row">
          <div class="col-md-5 left_box">

            <!--账号信息-->
            <div class = "row row_height">
                <div class="col-xs-3">Account</div><div class="col-xs-2" data-account="{{$account}}" id="info-id">{{$account}}</div></div>
            <div class = "row row_height row_bg">
                <div class="col-xs-3">Mobile</div><div class="col-xs-2">{{$mobile}}</div></div>
            <div class = "row row_height ">
                <div class="col-xs-3">Last area</div><div class="col-xs-2">{{$area_info[$lastAreaId]}}</div></div>
            <div class = "row row_height  row_bg">
                <div class="col-xs-3">Last login pid</div><div class="col-xs-2">{{$lastPlayerId}}</div></div>
            <div class = "row row_height">
                <div class="col-xs-3">Seal State</div><div class="col-xs-2">{!!$seal_alias!!}</div></div>
            <div class = "row row_height row_bg">
                <div class="col-xs-3">Freeze</div><div class="col-xs-2">{{$freeze ? '是' : '否'}}</div></div>

            <div class="row  row_height">
                <div class="col-xs-3">PlayerId</div>
                <div class="col-xs-7">{{$player_info['playerId']}}</div>
            </div>
            <div class="row row_height row_bg">
                <div class="col-xs-3">Name</div>
                <div class="col-xs-7">{{$player_info['name']}}</div>
            </div>
            <div class="row row_height">
                <div class="col-xs-3">Level</div>
                <div class="col-xs-7">{{$player_info['level']}}</div>
            </div>
            <div class="row row_height row_bg">
                <div class="col-xs-3">Vip Level</div>
                <div class="col-xs-7">{{$player_info['vip']}}</div>
            </div>
            <div class="row row_height">
                <div class="col-xs-3">Gold</div>
                <div class="col-xs-7">{{$player_info['gold']}}</div>
            </div>
            <div class="row row_height row_bg">
                <div class="col-xs-3">Diamond</div>
                <div class="col-xs-7">{{$player_info['diamond']}}</div>
            </div>
            <div class="row row_height">
                <div class="col-xs-3">Ticket</div>
                <div class="col-xs-7">{{$player_info['ticket']}}</div>
            </div>
            <div class="row row_height row_bg">
                <div class="col-xs-3">IP</div>
                <div class="col-xs-7">{{$player_info['ip']}}</div>
            </div>
            <div class="row row_height row_bg">
                <div class="col-xs-3">Account Time</div>
                <div class="col-xs-7">{{$createTime}}</div>
            </div>
            <div class="row row_height row_bg">
                <div class="col-xs-3">Role Time</div>
                <div class="col-xs-7">{{$player_info['create_time']}}</div>
            </div>
            <div class="row row_height row_bg">
                <div class="col-xs-3">Device</div>
                <div class="col-xs-7">{{$udid}} </div>
            </div>
            
            <!--end 账号信息-->

          </div>
            <!-- 角色列表-->
          <div class="col-md-7">
            <table class="table">
              <caption>role list</caption>
              <thead>
                <tr>
                  <th>#</th>
                  <th>hero name</th>
                  <th>role id</th>
                  <th>level</th>
                  <th>area</th>
                  <th>operation</th>
                </tr>
              </thead>
              <tbody>
                @foreach ($playerList as $i=> $obj)
                <tr>
                  <th scope="row">{{$i+1}}</th>
                  <td>{{$obj['playerName']}}</td>
                  <td>{{$obj['playerId']}}</td>
                  <td>{{$obj['level']}}</td>
                  <td>{{$area_info[$obj['areaId']]}}  ({{$obj['areaId']}})</td>
                  <td>
                    <a class="btn btn-danger " href="/admin/player/clear-rank?playerId={{$obj['playerId']}}&area={{$obj['areaId']}}&gm_value=0" role="button" >清除排行榜</a>
                    <!--<a class="btn btn-info " href="/admin/player/add-power?playerId={{$obj['playerId']}}&area={{$obj['areaId']}}" role="button" data-fld="" data-val="0">null</a>-->
                    <a class="btn btn-info " href="/admin/player/disable-chat?playerId={{$obj['playerId']}}&area={{$obj['areaId']}}" role="button" data-fld="" data-val="0">禁言</a>
                    @if ( empty($obj['role_seal']))
                    <a class="btn btn-warning " href="/admin/player/api-role-seal?playerId={{$obj['playerId']}}&area={{$obj['areaId']}}&role_seal=1&account={{$account}}" role="button" data-fld="" data-val="0">踢我</a>
                    @else
                    <a class="btn btn-info " href="/admin/player/api-role-seal?playerId={{$obj['playerId']}}&area={{$obj['areaId']}}&role_seal=0&account={{$account}}" role="button" data-fld="" data-val="0">允许上线</a>
                    @endif
                  </td>
                </tr>
                @endforeach
              </tbody>
            </table>
          </div>
            <!-- end 角色列表-->
        </div>
  </div>
</div>

<!-- 账号操作-->
<div class="panel panel-warning">
  <div class="panel-body">
    <p>
    账号管理
    </p>
    <a class="btn btn-info " href="/admin/areaorder/list-all?cp_account={{$account}}" role="button" >订单记录</a>
    <a class="btn btn-info " href="/admin/command?area={{$lastAreaId}}&pid={{$lastPlayerId}}" role="button" >GM命令</a>
    <a class="btn btn-danger " href="/admin/player/promote-gm?player_id={{$lastPlayerId}}&area={{$area}}&gm_value=2001" role="button" >我是GM</a>
    <a class="btn btn-warning " href="/admin/player/promote-gm?player_id={{$lastPlayerId}}&area={{$area}}&gm_value=0" role="button" >我不是GM</a>
    <a class="btn btn-danger " href="/admin/player/delete-account?account={{$account}}&area={{$area}}&gm_value=0" >删除账号</a>
    <a class="btn btn-danger " href="/admin/player/enclose-account?account={{$account}}&deleted_at=2&area={{$area}}&gm_value=0" >封设备</a>
    <a class="btn btn-info " href="/admin/player/enclose-account?account={{$account}}&deleted_at=0&area={{$area}}&gm_value=0" >取消封设备</a>
  </div>
</div>
<!-- 行为日志-->
<div class="panel panel-warning">
  <div class="panel-body">
    <p>
    行为日志
    </p>
    
    <a class="btn btn-info " href="/admin/player/behavior?player_id={{$lastPlayerId}}&area={{$area}}" role="button" >行为日志</a>
    <a class="btn btn-info " href="/admin/player/behavior?player_id={{$lastPlayerId}}&area={{$area}}&op=S.login" role="button" >登录日志</a>
    <a class="btn btn-info " href="/admin/behavior/group-behavior?player_id={{$lastPlayerId}}&area={{$area}}" role="button" >日志统计</a>
    <a class="btn btn-info " href="/admin/behavior/behavior-coin?player_id={{$lastPlayerId}}&area={{$area}}" role="button" >货币类型日志</a>  </div>
</div>

<script>
// 操作
$(function(){
    $('.account-act').click(function(){
        var data = {'account':$('#info-id').data('account')}
        data[$(this).data('fld')] = $(this).data('val');

        debugger;
        $.ajax({ 
            url:"{{url('/admin/player/ajaxActPlayer')}}",
            type:'GET', //GET
            async:false,    //或false,是否异步
            data:data,
            timeout:5000,    //超时时间
            dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
            success:function(data,textStatus,jqXHR){
                alert(data.msg + data.code);
                window.location.reload()
            },
            error:function(xhr,textStatus){
                console.log('错误')
                console.log(xhr)
                console.log(textStatus)
            }
        });
    });
});
</script>
<style>
.player_show_detail_table {
    padding:5px solid #ccc;
}
.player_show_detail_table .row_height{
    line-height:25px;
}
.player_show_detail_table .left_box {border:1px solid #ccc; }
.player_show_detail_table .row_bg{
    background:#f9f9f9;
}
</style>
